<template>
    <f7-page>
         <f7-navbar title="个人主页" back-link="返回">
                 <f7-nav-right>
                     <f7-link href="/mine/setting/" v-if="!isSao">设置</f7-link>
                     <f7-link>分享</f7-link>
                 </f7-nav-right>
        </f7-navbar>
         <!-- <div>
            <p v-if="personalInfo.company">{{personalInfo.company.nick_name}}</p>
            <p v-if="personalInfo.user">{{personalInfo.user.real_name}}</p>
            <p v-if="personalInfo.transport">
                运输：<span v-for="item in personalInfo.transport">{{item.chn}} </span>
            </p>
            <p v-if="personalInfo.count">货源：{{personalInfo.count.DRIVER_DEMAND}}
                线路：{{personalInfo.count.TRAFFIC_LINE}}</p>
        </div>

        <div>
            <ul>
                <li v-for="item in getMnLists" v-if="item.list">
                    <p>
                        {{item.list.send_city}}
                        <span>{{item.list.send_district}}</span>
                        {{item.list.receive_province}}
                        <span>{{item.list.receive_district}}</span>
                        <span>
                            {{item.list.amount}}吨{{item.list.category_chn}}
                            ￥{{item.list.price}}元/吨
                        </span>
                    </p>
                    <hr/>
                </li>
            </ul>
        </div>  -->


     <div class="bg-personpage">
                <div class="text-align-center">
                    <div>
                        <h4 class="text-black gap-20" v-if="personalInfo.company">
                            {{personalInfo.company.nick_name}}
                        </h4>
                        <h4 class="text-orange gap-10"></h4>
                    </div>
                      <img  class="companyhome-icon gap-20" src="../../assets/img/infor-face.png" >
                        <h3 class="text-black" v-if="personalInfo.user">
                            {{personalInfo.user.real_name}}
                        </h3>
                         <h4 class="text-gray gap-10 line-height" v-if="personalInfo.transport">
                                <span>运输:</span>
                                <span class="distance" v-for="item in personalInfo.transport">{{item.chn}}</span>
                        </h4>
                </div>
                <div class="bg-companynpage">
                <div class="row row-homepage text-align-center text-gray gap-20" >
                        <div class="col text-orange" v-if="personalInfo.count">
                            <h4>货源</h4>
                            <h4 class="gap-5 ng-binding">{{personalInfo.count.DRIVER_DEMAND}}</h4>
                        </div>

                        <div class="col text-orange" v-if="personalInfo.count">
                            <h4>线路</h4>
                            <h4 class="gap-5 ng-binding">{{personalInfo.count.TRAFFIC_LINE}}</h4>
                        </div>
                    </div>
                </div>
       </div>

     <f7-block class="text-align-center">
                                <span class="order-title">2018年07月04日</span>
            </f7-block>

       <f7-card  v-for="item in getMnLists" v-if="item.list">
            <f7-card-header>
                <div class="text-left">
                    <img src='../../assets/img/pass-icon1.png' class="line-icon">
                    <div class="pull-left">
                        <b>{{item.list.send_city}}</b>
                        <span>{{item.list.send_district}}</span>

                    </div>
                </div>
                <div class="text-center">
                    <h5 class="The_of"> {{item.list.amount}}吨{{item.list.category_chn}}</h5>
                    <h5 class="text-orange status-bg">￥{{item.list.price}}元/吨</h5>

                </div>
                <div class="text-right">
                    <div class="pull-right">
                        <b>{{item.list.receive_province}}</b>
                         <span>{{item.list.receive_district}}</span>
                    </div>
                </div>
            </f7-card-header>
           <div>
               <h5 class="text-red  binding" v-if="item.list.verify_driver">
                   车辆：<span v-if="">待接单{{item.list.verify_driver.length}}，</span>
                   待派货0，
                   <span> 运输中{{item.list.offer_count}}，</span>
                   已运完0
               </h5>
           </div>
        </f7-card>
        <f7-toolbar v-if="isSao">
            <div class="row button-foot">
                <div class="col col-100 col-green" @click="addFrend()" >添加好友</div>
            </div>
        </f7-toolbar>












    </f7-page>
</template>

<script>
    import F7Page from "framework7-vue/src/components/page";
    import F7Navbar from "framework7-vue/src/components/navbar";
    export default {
        name: "personalPage",
        components: {F7Navbar, F7Page},
        data(){
            return{
                isSao:false,
                personalInfo:'',
                getMnLists:''
            }
        },
        methods:{
            async getPersonnalDlt () {
                let param = {user_id: this.routerParams.personalid}
                this.personalInfo = (await this.AccountService.getPersonalPage(param)).data.data

            },
            async getMnCardDlist () {
                let param = {user_id: this.routerParams.personalid,page: 1, type: "traffic_driver_demand"}
                this.getMnLists = (await this.OtherService.getBsList(param)).data.data.list

            },
            addFrend(){
                alert('别瞎点')
            }
        },
        created(){
            this.getPersonnalDlt()
            this.getMnCardDlist()
            this.isSao=this.routerParams.isSao
        }
    }
</script>

<style scoped>
.ios .page {
    background: #f5f5f5;
  }
.text-black {
    color: #333;
}
.gap-20 {
    margin-top: 20px;
}
.text-orange {
    color: #FF6C00;
}
.gap-10 {
    margin-top: 10px;
}
.gap-5{
    margin-top: 5px;
}
.companyhome-icon {
    border: 2px solid #fff;
    border-radius: 100%;
    width: 100px;
    height: 100px;
    box-sizing: border-box;
}
.text-gray {
    color: #999;
    font-size: 12px;
}
.row-homepage .col.text-orange .ng-binding {
    color: #E45102;
    font-weight: bold;
    font-size: 14px;
}
.distance{
    margin: 0px 4px;
}
.order-title {
    padding: 2px 10px;
    border-radius: 5px;
    display: inline-block;
    font-size: 11px;
    color: #666;
}
    /* 卡片css  */
.card-header {
    padding: 15px 15px 5px 15px !important;
    position: static;
}
.binding{
     padding: 5px 15px;
}
    .text-left {
        position: relative;
    }

    .line-icon {
          position: absolute;
        left: -3px;
        width: 16px;
        height: 45px;
        top: -4px;
    }

    .status-bg {
        background: url('../../assets/img/route-bg.png') no-repeat top center;
        background-size: 95px 4px;
        padding-top: 7px;
        width: 97px;
    }
    .The_of{
        text-align: center;
        color: #666;
        font-size: 12px;
    }
    .pull-left {
        text-align: left;
        margin-left: 20px;
    }

    .pull-right {
        text-align: right;
    }

    .pull-left span {
        font-size: 12px;
        color: #666;
        display: block;
    }

    .pull-left b {
        font-size: 14px;
        color: #000;
        display: block;
    }

    .pull-right span {
        font-size: 12px;
        color: #666;
        display: block;
        width: 48px;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }

    .pull-right b {
        font-size: 14px;
        color: #000;
        display: block;
    }
    .text-right span {
        margin: 0 0 3px 0;
        font-size: 10px;
        color: #666;
    }
    .text-red {
    color: #DB4226;
    font-size: 12px;
}
.text-orange {
    color: #FF6C00;
    font-size: 12px;
    text-align: center;
}

.button-foot .col-light {
    background: #fff;
    color: #999;
    border-left: 1px solid #f5f5f5;
    font-size: 14px;
    text-align: center;
    width: 50% !important;
}
.button-foot .col-green {
    color: #fff;
    background: #68b54b;
}
.button-foot {
    text-align: center;
    width: 100%;
    position: relative;
    font-size: 14px;
    line-height: 42px;
}
</style>
